package com.NetWork.PlayerStatus;

import com.Gameplay.character.Role.parentRole;


public class UpdateHandler {
    // x y pushX
    public void LogicalPositionUpdate(PlayerStatus playerOneStatus, PlayerStatus playerTwoStatus, parentRole p1, parentRole p2) {
        p1.update(playerOneStatus.getX(), playerOneStatus.getY(), playerTwoStatus.getTx());
        p2.update(playerTwoStatus.getX(), playerTwoStatus.getY(), playerOneStatus.getTx());
    }

    //health energy
    public void PlayerStatusUpdate(PlayerStatus playerOneStatus, PlayerStatus playerTwoStatus, parentRole p1, parentRole p2) {
        //Health更新
        p1.setHealth(p1.getHealth() - playerTwoStatus.getDamage());
        p2.setHealth(p2.getHealth() - playerOneStatus.getDamage());
        //Blocking 更新
        p1.setIsblocking(playerOneStatus.isBlocking());
        p2.setIsblocking(playerTwoStatus.isBlocking());
    }

}
